package com.oa.commons.beans;

import java.util.List;

public class NewsLabel {
    private int id;
    private int pid;
    private String name;//栏目名称
    private String content;//栏目内容
    //关联属性，将当前类看作一方（父栏目），则关联属性就是多方（子栏目）
    private NewsLabel parent;
    //关联属性，将当前类看作多方（子栏目），则关联属性就是一方（父栏目）
    private List<NewsLabel> children;

    public NewsLabel() {
    }

    public NewsLabel(int pid, String name, String content, NewsLabel parent, List<NewsLabel> children) {
        this.pid = pid;
        this.name = name;
        this.content = content;
        this.parent = parent;
        this.children = children;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public NewsLabel getParent() {
        return parent;
    }

    public void setParent(NewsLabel parent) {
        this.parent = parent;
    }

    public List<NewsLabel> getChildren() {
        return children;
    }

    public void setChildren(List<NewsLabel> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "NewsLabel{" +
                "id=" + id +
                ", pid=" + pid +
                ", name='" + name + '\'' +
                ", content='" + content + '\'' +
                ", parent=" + parent +
                ", children=" + children +
                '}';
    }
}
